{% extends "device.html" %}

{% block right %}
    <div class="content">
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/device.css">
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/tables.css">

        <div>
          <form id="form1" name="form1" method="post" action="">
            <label> &nbsp; 设备IP &nbsp;
            <input type="text" name="IP" id="textfield" /> &nbsp;
            <input type="hidden" name="Type" value="Modify" />
            <input type="submit" name="Button" id="button" value="提交" />
          </form>
        </div>

        {% if results %}
        <div style="text-align;" class="tables"> 
          <table class="colorTable" style="width:98%;" border="1" cellspacing="0" cellpadding="0" align="center"> 
          <tbody> 
            <tr> 
            <th width="11.1%" height="15" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">设备IP</p> 
            </th> 
            <th width="11.1%"  valign="top" bgcolor="#CCCCCC"> 
            <p align="center">CPU信息</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">内存信息</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">磁盘信息</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">设备位置</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">设备状态</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">所运行服务</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">所属人</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center"></p> 
            </th> 
            </tr> 
            
            {% for bd in results %}
            <tr> 
            </td height=10 > 
            <td > 
            <p>{{ bd.Ip }}</p>
            </td> 
            <td > 
            <p>{{ bd.Cpu }}</p> 
            </td> 
            <td > 
            <p>{{ bd.Mem }}</p>
            </td> 
            <td > 
            <p>{{ bd.Disk }}</p> 
            </td> 
            <td > 
            <p>{{ bd.Position }}</p> 
            </td> 
            <td > 
            <p>{{ bd.State }}</p> 
            </td> 
            <td > 
            <p>{{ bd.Server }}</p> 
            </td> 
            <td > 
            <p>{{ bd.Owner }}</p> 
            </td> 
            <td > 
            <form class="from2" name="form2" method="post" action="" >
              <input type="hidden" name="MDID" value="{{ bd.id }}" /> 
              <input type="submit" name="Button" id="button" value="修改" />
            </form>
            </td> 
            </tr> 
            {% endfor %}

          </tbody> 
          </table>
        </div>
        {% endif %}

        {% if MDID %}
        <div style="text-align;" class="tables"> 
         <form class="from2" name="form2" method="post" action="" >
          <table class="colorTable" style="width:98%;" border="1" cellspacing="0" cellpadding="0" align="center"> 
          <tbody> 
            <tr> 
            <th width="11.1%" height="15" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">设备IP</p> 
            </th> 
            <th width="11.1%"  valign="top" bgcolor="#CCCCCC"> 
            <p align="center">CPU信息</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">内存信息</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">磁盘信息</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">设备位置</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">设备状态</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">所运行服务</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center">所属人</p> 
            </th> 
            <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
            <p align="center"></p> 
            </th> 
            </tr> 
            
            <tr> 
            </td height=10 > 
            <td > 
              <input type="txt" name="IP" value="{{ MDID.Ip }}" />
            </td> 
            <td > 
              <input type="txt" name="CPU" value="{{ MDID.Cpu }}" />
            </td> 
            <td > 
              <input type="txt" name="MEM" value="{{ MDID.Mem }}" />
            </td> 
            <td > 
              <input type="txt" name="DISK" value="{{ MDID.Disk }}" />
            </td> 
            <td > 
              <input type="txt" name="POSITION" value="{{ MDID.Position }}" />
            </td> 
            <td > 
              <input type="txt" name="STATE" value="{{ MDID.State }}" />
            </td> 
            <td > 
              <input type="txt" name="SERVER" value="{{ MDID.Server }}" />
            </td> 
            <td > 
              <input type="txt" name="OWNER" value="{{ MDID.Owner }}" />
            </td> 
            <td>
              <input type="hidden" name="MDID" value="{{ MDID.id }}" /> 
              <input type="hidden" name="Type" value="Modify" />
              <input type="hidden" name="Change" value="OK" />
              <input type="submit" name="Button" class="button" value="提交" />
            </td>
            </tr> 
          </tbody> 
          </table>
         </form>
        </div> 
        {% endif %}

        {% if Change %}
            <h2 style="text-align: center;">修改完成</h2>
        {% endif %}

    </div>  
{% endblock %}
